package com.ly.hotel.spainterface.jyt;

import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;

import androidx.core.content.ContextCompat;

import com.ly.hotel.MyBaseActivity;
import com.ly.hotel.R;
import com.ly.hotel.spainterface.jyt.bean.MachineBean;
import com.ly.hotel.spainterface.jyt.utils.MachineUtils;
import com.ly.hotel.view.TitleLayout;

/**
 * Created by ThinkPad on 2018/3/17.
 */

public class JytActivity extends MyBaseActivity {

    private static final String TAG = "JytActivity";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.jyt_xiaofei_activity);
        getMachineInfo();
        initTitle();
    }

    // 获取电视相关信息
    public void getMachineInfo(){
        MachineBean machineInfo = MachineUtils.getHostAndTvInfo();
        if(machineInfo != null){
            Log.i(TAG,"serverIP=" + machineInfo.getServerIP());
            Log.i(TAG,"serverPORT=" + machineInfo.getServerPORT());
            Log.i(TAG,"mac=" + machineInfo.getMac());
            Log.i(TAG,"categoryName=" + machineInfo.getCategoryName());
            Log.i(TAG,"tvName=" + machineInfo.getTvName());
        }
    }

    // 初始化标题栏
    public void initTitle(){
        TitleLayout titleLayout = findViewById(R.id.title_layout);
        TextView titleName = titleLayout.findViewById(R.id.activity_name);
        titleName.setTextColor(ContextCompat.getColor(this,R.color.mainWhite));
        titleName.setText("消费");
    }
}
